package org.example.xxljob;

import lombok.extern.slf4j.Slf4j;
import org.example.Result;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class XxlJobServiceApiFallback  implements FallbackFactory<XxlJobServiceApi> {
    @Override
    public XxlJobServiceApi create(Throwable cause) {
        return () -> {
            log.error("调用#业务名称#API失败， 异常信息: " , cause);
            return Result.error(500, "调用#业务名称#API失败");
        };
  }
}
